import React from "react";
import { Navigate } from "react-router-dom";
// import Home from "../pages/home";
// import Major from "../pages/major";
// import Own from "../pages/own";
// import Organization from "../pages/organization";
// import Crouse from "../pages/course";
// import Product from "../pages/product";
// import Student from "../pages/student";

const Login = React.lazy(() => import("../pages/login"));
const NotFound = React.lazy(() => import("../baseUI/404"));
const Home = React.lazy(() => import("../pages/home"));
const DataPanel = React.lazy(() => import("../pages/dataPanel"));
const Major = React.lazy(() => import("../pages/major"));
const Own = React.lazy(() => import("../pages/own"));
const Organization = React.lazy(() => import("../pages/organization"));
const Crouse = React.lazy(() => import("../pages/course"));
const Product = React.lazy(() => import("../pages/product"));
const Student = React.lazy(() => import("../pages/student"));

const Routers = [
  {
    path: "/",
    element: <Navigate to="/home" />,
    name: "默认"
  },
  {
    path: "/home",
    element: <Home />,
    name: "首页",
    children: [
      {
        path: "/home/major",
        element: <Major />,
        name: "首页主页面",
        showOrgUnSelectedPage: false
      },
      {
        path: "/home/dataPanel",
        element: <DataPanel />,
        name: "数据面板",
        showOrgUnSelectedPage: true
      },
      {
        path: "/home/own",
        element: <Own />,
        name: "个人信息",
        showOrgUnSelectedPage: false
      },
      {
        path: "/home/organization",
        element: <Organization />,
        name: "门店管理",
        showOrgUnSelectedPage: false
      },
      {
        path: "/home/course",
        element: <Crouse />,
        name: "课程管理",
        showOrgUnSelectedPage: true
      },
      {
        path: "/home/product",
        element: <Product />,
        name: "商品管理",
        showOrgUnSelectedPage: true
      },
      {
        path: "/home/student",
        element: <Student />,
        name: "学员管理",
        showOrgUnSelectedPage: true
      }
    ]
  },
  {
    path: "/login",
    element: <Login />,
    name: "登录"
  },
  {
    path: "*",
    element: <NotFound />,
    name: "未找到"
  }
];

export default Routers;
